Scientific notation for floats?

James Harkins's icon

Potentially dumb question:

Let's say I want to decimate effectively down to 1 bit by taking some signal times a really big number, and clipping to 0.0 - 1.0.

Do I have to write [*~ 1000000000000000000000000000000.] or is there a civilized way to write 1e+30 or such?

hjh

Roman Thilenius's icon

there is bitshift~ ... unless you need to control it by a signal.

ecuk's icon

If your ‘big number’ changes only at control rate instead of signal rate, you could try either pow or pow within expr.

Wetterberg's icon

if the idea is that you want to do a fluid bit reduction type thing, have a goooood solid look at [round~ ]...

James Harkins's icon

It just surprises me that scientific notation is disallowed, when it's standard in just about every programming environment. If Max converted strings for floating-point literals into float values using std::stof() or std::stod() then it would get scientific notation for free. Preventing it means writing their own string-to-float function, which is extra work for reduced functionality.

(Though in this context, actually [>~ 0] would be one less object... silly me for not seeing that.)

hjh