lcn2 / calc

C-style arbitrary precision calculator
http://www.isthe.com/chongo/tech/comp/calc/index.html
Other
358 stars 51 forks source link

Cant figure out how to get percent. #13

Closed VladSavitsky closed 4 years ago

VladSavitsky commented 4 years ago

version 2.12.7.2 I need some help. I want to get the percent. For example: 2% from 400 = 8

; 400%2
    0
; 400*%2
Missing expression

; 400*2%
Missing expression

; %2*400
Missing expression

; 2%400
    2
; 

How to get 8?

timocp commented 4 years ago

Hi Vlad, in calc % is not for percentages, it is a modulus operator. 2 percent is 2/100, so what you want is:

; 400 * (2/100)
    8
VladSavitsky commented 4 years ago

Got it. Thanks.