Is there some way, using expressions, of ignoring the fact a number is a negative value, and just treating it as a positive? Sort of like how round() ignores the decimal point, can you tell c2 just consider -50 as 50, -100 as 100, etc?
[quote:2dnlo44b]abs(x) Absolute value of x e.g. abs(-5) = 5
[quote:19l3u159]abs(x) Absolute value of x e.g. abs(-5) = 5
Thankyou!
On the flip side, is there a function to shift a value one decimal point to the right, "4" becomes "0.4"?
Just divide by 10.
Of course! Is there a way of making single digits (1-9) become 0.1-0.9, then 10-19 become 0.10-0.19?
Every time you divide by 10 it moves the digits over to the right one. In your second example it happens twice so
90/10/10 or 90/100 = 0.9
http://www.mathsisfun.com/
good site to learn
mathsisfun.com good site to learn
mathsisfun.com
Zebbi ,My link was not a jab at you personally so please do not take it as such . As a 40 year educator and opponent on the curriculum now used to teach mathematics , I have used every means at my disposal to teach what USED to be considered basic knowledge . I have recommended this site to PHD's who could not even balance their check book , yet were outstanding Teachers . I meant no offense toward your intellect , this site is full of knowledge and done in a fast and easy way .
If you want to take an n-digits integer and consider it as a fraction of 1 (i.e. 234 => 0.234), you can do this
10^(-len(str(Variable))) * Variable[/code:24l87r4k]or[code:24l87r4k]float("0." & Variable)[/code:24l87r4k]
Develop games in your browser. Powerful, performant & highly capable.
Thx 4 that Site.