Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Number Stuff
- rrch6000
-
16 posts
Number Stuff
I need an equation that make's low numbers (that are not negative) into high numbers.
Please help!
Please help!

- dimitrip
-
500+ posts
Number Stuff
To turn something (lets's say variable x) between 0 and 1, into something between infinite and 1, you can use
Dimitri.
Greetz,
Dimitri.
- gtoal
-
1000+ posts
Number Stuff
I need an equation that make's low numbers (that are not negative) into high numbers.
I don't want the number to be random
OK, you're about 1/10th the way towards specifying what you want in enough detail to actually implement it. Keep going.
- rrch6000
-
16 posts
Number Stuff
Well, if the number is high then the output will be low. And the higher the number gets, then the lower the output is.
If the number is low, then the output is high. the lower the number, the higher the output.
The output cannot be negative though.
If the number is low, then the output is high. the lower the number, the higher the output.
The output cannot be negative though.
- TheLogFather
-
1000+ posts
Number Stuff
A few questions…
Do you have a limited range for the input number? Or could it have any value? Can it be negative? Can it be zero? Can it be only integer?
And the output… do you want it to be within some (positive) range? Can it be zero? If it can be zero, would that correspond to the input being infinite (or its max. possible value)? Do you want the output to be only an integer?
If you could provide any more info about the context for this numerical transformation, it would help to narrow down the possible algorithms…
Do you have a limited range for the input number? Or could it have any value? Can it be negative? Can it be zero? Can it be only integer?
And the output… do you want it to be within some (positive) range? Can it be zero? If it can be zero, would that correspond to the input being infinite (or its max. possible value)? Do you want the output to be only an integer?
If you could provide any more info about the context for this numerical transformation, it would help to narrow down the possible algorithms…
Last edited by TheLogFather (July 13, 2015 15:11:13)
- discocarp
-
7 posts
Number Stuff
The simplest answer, if you have a range of values, is result=max-val. Add one if you don't want zeroes.
Example, your numbers will always be between 1 and 100, and you want your result to also be between 1 and 100.
In this case, use: result=101-val
So if val is 65:
result=101-val
result=101-65
result=36
Example, your numbers will always be between 1 and 100, and you want your result to also be between 1 and 100.
In this case, use: result=101-val
So if val is 65:
result=101-val
result=101-65
result=36
- Discussion Forums
- » Help with Scripts
-
» Number Stuff