Give some tips on which algorithms you use or your solution to solve some problems as follows:
//Some string NSString *s = @"5*(2.56-1.79)-4.1";
You can do this:
NSExpression *expression = [NSExpression expressionWithFormat:s]; float result = [[expression expressionValueWithObject:nil context:nil] floatValue]; NSLog(@"%f", result);
This is easy to do with expressionWithFormat
expressionWithFormat
NSString *equation = @"5*(2.56-1.79)-4.1"; NSNumber *result = [NSExpression expressionWithFormat:equation]; NSLog(@"%@", result);
Source: https://habr.com/ru/post/1548113/More articles:How to disable Elicsearch search in Node.js? - node.jsGrunt time while running jasmine test - gruntjsGroup tests using EPPlus - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1548111/git-awspush-is-not-a-git-command-when-trying-to-push-a-repository-to-amazon-elastic-beanstalk-on-mac&usg=ALkJrhjQALV_0yNZ20SWSt9Ppkk2NEqg8QNSExpression Calculator in Swift - iosPython - What is a lazy property? - pythonProblems with the amount of data when querying data from SQL Server using PostgreSQL external data shell - sql-serverweb2py dal sql 'like' equivalent - web2pyDoes OPTIONS query make 2x application slower? - apiHow do filters work in wtforms? - wtformsAll Articles