5 + { arg aNumber, adverb; _AddFloat; ^aNumber.performBinaryOpOnSimpleNumber('+', this, adverb) }
6 - { arg aNumber, adverb; _SubFloat; ^aNumber.performBinaryOpOnSimpleNumber('-', this, adverb) }
7 * { arg aNumber, adverb; _MulFloat; ^aNumber.performBinaryOpOnSimpleNumber('*', this, adverb) }
9 clip { arg lo, hi; _ClipFloat; ^this.primitiveFailed }
10 wrap { arg lo, hi; _WrapFloat; ^this.primitiveFailed }
11 fold { arg lo, hi; _FoldFloat; ^this.primitiveFailed }
13 coin { ^1.0.rand < this }
14 xrand2 { ^this.rand2 }
17 // returns an Integer which is the bit pattern of this as a
18 // 32bit single precision float
19 as32Bits { _As32Bits }
21 // returns an Integer which is the bit pattern of high
22 // 32 bits of the 64 bit double precision floating point value
23 high32Bits { _High32Bits }
24 low32Bits { _Low32Bits }
26 *from32Bits { arg word;
30 *from64Bits { arg hiWord, loWord;
37 // iterates function from 0 to this-1
38 // special byte codes inserted by compiler for this method
40 while ({ (i + 0.5) < this }, { function.value(i, i); i = i + 1.0; });
43 reverseDo { arg function;
44 // iterates function from this-1 to 0
45 // special byte codes inserted by compiler for this method
48 while ({ (i + 0.5) >= 0.0 }, { function.value(i, j); i = i - 1.0; j = j + 1.0; });
51 asStringPrec { arg precision;
56 archiveAsCompileString { ^true }
58 // the correct place to implement compileString for Float is in DumpParseNode.cpp
59 // int asCompileString(PyrSlot *slot, char *str)
60 // for now, solve it here.
64 if(this == inf) { stream << "inf"; ^this };
65 if(this == -inf) { stream << "-inf"; ^this };
68 // if it doesn't already have a . or is 1e-05 then add a .0 to force it to Float
69 if(str.find(".").isNil and: { str.find("e").isNil }) {
75 "Float:switch is unsafe, rounding via Float:asInteger:switch".warn;
76 ^this.asInteger.switch(*cases)