37+ results for 'while !isfinite(x)' (0 ms)
Not the results you expected?
Numbers.js (git://github.com/mbostock/protovis.git) JavaScript · 313 lines
25 stop -= (stop - start) * 1e-10; // floating point precision!
26 if (step < 0) {
27 while ((j = start + step * i++) > stop) {
28 array.push(j);
29 }
30 } else {
31 while ((j = start + step * i++) < stop) {
32 array.push(j);
33 }
266 */
267 pv.logAdjusted = function(x, b) {
268 if (!isFinite(x)) return x;
269 var negative = x < 0;
270 if (x < b) x += (b - x) / b;
random.js (https://github.com/mattdesl/canvas-sketch-util.git) JavaScript · 328 lines
65 function valueNonZero () {
66 var u = 0;
67 while (u === 0) u = value();
68 return u;
69 }
88 function noise1D (x, frequency, amplitude) {
89 if (!isFinite(x)) throw new TypeError('x component for noise() must be finite');
90 frequency = defined(frequency, 1);
91 amplitude = defined(amplitude, 1);
95 function noise2D (x, y, frequency, amplitude) {
96 if (!isFinite(x)) throw new TypeError('x component for noise() must be finite');
97 if (!isFinite(y)) throw new TypeError('y component for noise() must be finite');
98 frequency = defined(frequency, 1);
luroth_expansion.hpp (https://github.com/VoltDB/voltdb.git) C++ Header · 138 lines
25 using std::sqrt;
26 using std::isfinite;
27 if (!isfinite(x))
28 {
29 throw std::domain_error("Cannot convert non-finites into a Lüroth representation.");
47 Real i = 1;
48 Real scale = std::numeric_limits<Real>::epsilon()*abs(x_)/2;
49 while (abs(x_ - computed) > (i++)*scale)
50 {
51 Real recip = 1/x;
caml_int64.js (https://github.com/phated/reasonable.git) JavaScript · 626 lines
180 function mul(_this, _other) {
181 while(true) {
182 var other = _other;
183 var $$this = _this;
367 function of_float(x) {
368 if (isNaN(x) || !isFinite(x)) {
369 return zero;
370 } else if (x <= neg_two_ptr_63) {
386 function div(_self, _other) {
387 while(true) {
388 var other = _other;
389 var self = _self;
blue_641922.js (https://github.com/Microsoft/ChakraCore.git) JavaScript · 92 lines
11 function test0() {
12 function makeArrayLength(x) {
13 if (x < 1 || x > 4294967295 || x != x || isNaN(x) || !isFinite(x)) return 100;
14 else return Math.floor(x) & 0xffff;
15 };;
72 function func7() {}
73 }
74 } while (((~((new Error('abc')) instanceof((typeof RegExp == 'function') ? RegExp : Object)))) && __loopvar0 < 3)
75 if ((((protoObj1.prop1--) != (((VarArr0.unshift(((parseInt("-60") instanceof((typeof EvalError == 'function') ? EvalError : Object)) instanceof((typeof Error == 'function') ? Error : Object)), (++protoObj1.length), ((-1773563946 * 84 + 4294967296) == arrObj0.prop1), (arrObj0.prop0 %= aliasOfi16[(protoObj0.prop0) & 255]), ({}
76 instanceof((typeof EvalError == 'function') ? EvalError : Object)), (('prop0' in arrObj0) * ((d ? 468055979.1 : h) + 773168218.1)), (('prop0' in arrObj0) ? (-1.85965069094854E+18 >= -221) : -147671108.9), ((-527800715 ? f : arrObj0.prop0) ? aliasOfIntArr0[(((protoObj0.prop0 >= 0 ? protoObj0.prop0 : 0)) & 0XF)] : (('prop0' in arrObj0) * ((d ? 468055979.1 : h) + 773168218.1))), arrObj0.length, protoObj0.prop0)) * aliasOfFloatArr0[(18)] - ui8[((FloatArr2[(38)] * (test0.caller) - aliasOfIntArr0[(((protoObj0.prop0 >= 0 ? protoObj0.prop0 : 0)) & 0XF)])) & 255]) * (h >>>= func0()) - (protoObj0.prop1 >= protoObj1.prop0))) != (parseInt("-60") instanceof((typeof EvalError == 'function') ? EvalError : Object)))) {
engel_expansion.hpp (https://github.com/nickorr/BaseElements-Plugin.git) C++ Header · 115 lines
25 using std::sqrt;
26 using std::isfinite;
27 if (!isfinite(x))
28 {
29 throw std::domain_error("Cannot convert non-finites into an Engel expansion.");
43 Real scale = std::numeric_limits<Real>::epsilon()*abs(x_)/2;
44 Real u = x;
45 while (abs(x_ - computed) > (i++)*scale)
46 {
47 Real recip = 1/u;
download.jl (https://github.com/JuliaWeb/HTTP.jl.git) Julia · 147 lines
92 function download(url::AbstractString, local_path=nothing, headers=Header[]; update_period=1, kw...)
93 format_progress(x) = round(x, digits=4)
94 format_bytes(x) = !isfinite(x) ? "∞ B" : Base.format_bytes(x)
95 format_seconds(x) = "$(round(x; digits=2)) s"
96 format_bytes_per_second(x) = format_bytes(x) * "/s"
132 Base.open(file, "w") do fh
133 while(!eof(stream))
134 downloaded_bytes += write(fh, readavailable(stream))
135 if !isinf(update_period)
caml_int64.js (https://github.com/BuckleScript/bucklescript.git) JavaScript · 595 lines
163 function mul(_this, _other) {
164 while(true) {
165 var other = _other;
166 var $$this = _this;
320 function of_float(x) {
321 if (isNaN(x) || !isFinite(x)) {
322 return zero;
323 } else if (x <= -9.22337203685477581e+18) {
378 function div(_self, _other) {
379 while(true) {
380 var other = _other;
381 var self = _self;
centered_continued_fraction.hpp (https://bitbucket.org/bosp/external-boost.git) C++ Header · 166 lines
luroth_expansion.hpp (https://bitbucket.org/bosp/external-boost.git) C++ Header · 138 lines
25 using std::sqrt;
26 using std::isfinite;
27 if (!isfinite(x))
28 {
29 throw std::domain_error("Cannot convert non-finites into a Luroth representation.");
47 Real i = 1;
48 Real scale = std::numeric_limits<Real>::epsilon()*abs(x_)/2;
49 while (abs(x_ - computed) > (i++)*scale)
50 {
51 Real recip = 1/x;
generator.js (https://github.com/PatMartin/Dex.git) JavaScript · 207 lines
108 z = ztu(t,u);
109 if (isNaN(x) || (x == Number.NEGATIVE_INFINITY) ||
110 (x == Number.POSITIVE_INFINITY) || (Math.abs(x) > 2e5) || !isFinite(x)) {
111 //x=0;
112 x = Number.NaN;
155 var xi = 0, yi = 0, c, max_yi = 140, max_xi = 140;
156 while (theta <= piA)
157 {
158 phi = -piB/2;
160 r1 = Math.pow(Math.pow(Math.abs((1/a)*Math.cos(m*theta/4)),n2)+Math.pow(Math.abs((1/b)*Math.sin(m*theta/4)),n3),-1/n1);
161 yi = 0;
162 while (phi <= piB/2)
163 {
164 //r2 = 1/Math.pow((Math.pow(Math.abs(Math.cos(m*phi/4)/a)),n2)+Math.pow((Math.abs(Math.sin(m*phi/4)/b)),n3),n1);
floor.c (git://github.com/jeremybarnes/cephes.git) C · 453 lines
lgammaf.c (https://github.com/ziglang/zig.git) C · 187 lines
lgammaf.c (git://pkgs.fedoraproject.org/mingw-crt) C · 189 lines
grisu.jl (https://github.com/SinSiXX/julia.git) Lisp · 182 lines
28 # wrapper for the core grisu function, primarily for debugging
29 function grisu(x::Float64, mode::Integer, ndigits::Integer)
30 if !isfinite(x); error("non-finite value: $x"); end
31 if ndigits < 0; error("negative digits requested"); end
32 @grisu_ccall x mode ndigits
68 pt = int(POINT[1])
69 if mode == PRECISION
70 while len > 1 && DIGITS[len] == '0'
71 len -= 1
72 end
89 # => 0.00########
90 write(io, "0.")
91 while pt < 0
92 write(io, '0')
93 pt += 1
tgammaf.c (git://pkgs.fedoraproject.org/mingw-w64-tools) C · 195 lines
bug1868543.js (https://github.com/Microsoft/ChakraCore.git) JavaScript · 35 lines
6 var ary = new Array(10);
7 var e = -6;
8 function makeArrayLength(x) { if (x < 1 || x > 4294967295 || x != x || isNaN(x) || !isFinite(x)) return 100; else return Math.floor(x) & 0xffff; };;
9 var func3 = function (argStr4, argArr5, argArr6) {
10 var re1 = /ab[b7]ba/m;
18 arrObj0.prop0 = (((argArr5.reverse()) instanceof ((typeof Boolean == 'function') ? Boolean : Object)) << (argArr6[(((arrObj0.prop0 >= 0 ? arrObj0.prop0 : 0)) & 0XF)] + i8[(18) & 255]));
19 obj1.length = makeArrayLength(undefined);
20 } while (((argArr5[(loopInvariant)] * ary[((((argArr6[(((arrObj0.prop0 >= 0 ? arrObj0.prop0 : 0)) & 0XF)] + i8[(18) & 255]) >= 0 ? (argArr6[(((arrObj0.prop0 >= 0 ? arrObj0.prop0 : 0)) & 0XF)] + i8[(18) & 255]) : 0)) & 0XF)] + ((obj1.prop1 !== e) || (arrObj0.prop0 != obj1.length)))))
21 return (5 in arrObj0);
22 };
test122.js (https://github.com/Microsoft/ChakraCore.git) JavaScript · 35 lines
typ.js (http://story-steward.googlecode.com/svn/trunk/) JavaScript · 489 lines
floor.c (https://github.com/nearform/node-cephes.git) C · 398 lines
e.c (https://github.com/casey/e.git) C · 297 lines
download.jl (https://github.com/fredrikekre/HTTP.jl.git) Julia · 142 lines
91 function download(url::AbstractString, local_path=nothing, headers=Header[]; update_period=1, kw...)
92 format_progress(x) = round(x, digits=4)
93 format_bytes(x) = !isfinite(x) ? "∞ B" : Base.format_bytes(x)
94 format_seconds(x) = "$(round(x; digits=2)) s"
95 format_bytes_per_second(x) = format_bytes(x) * "/s"
129 Base.open(file, "w") do fh
130 while(!eof(stream))
131 downloaded_bytes += write(fh, readavailable(stream))
132 if now() - prev_time > Millisecond(1000update_period)
Numbers.js (https://github.com/bigfix/protovis.git) JavaScript · 312 lines
24 var array = [], i = 0, j;
25 if (step < 0) {
26 while ((j = start + step * i++) > stop) {
27 array.push(j);
28 }
29 } else {
30 while ((j = start + step * i++) < stop) {
31 array.push(j);
32 }
265 */
266 pv.logAdjusted = function(x, b) {
267 if (!isFinite(x)) return x;
268 var negative = x < 0;
269 if (x < b) x += (b - x) / b;
grisu.jl (https://github.com/biegelk/julia.git) Lisp · 165 lines
30 global grisu, grisu_fix, grisu_sig
31 function grisu(x::Float64, mode::Integer, ndigits::Integer)
32 if !isfinite(x); error("non-finite value: $x"); end
33 if ndigits < 0; error("negative digits requested"); end
34 @grisu_ccall x mode ndigits
58 pt = POINT[1]
59 if mode == PRECISION
60 while len > 1 && DIGITS[len] == '0'
61 len -= 1
62 end
79 # => 0.00########
80 write(io, "0.")
81 while pt < 0
82 write(io, '0')
83 pt += 1
pike_float.h (git://github.com/pikelang/Pike.git) C Header · 91 lines
match.c (https://github.com/nclack/whisk.git) C · 543 lines
33 #ifndef isinf
34 #define isinf(x) (!isfinite(x))
35 #endif
100 distMatrixTemp = distMatrix;
101 while(distMatrixTemp < distMatrixEnd)
102 {
103 value = *distMatrixTemp++;
121 infValue = 10;
122 distMatrixTemp = distMatrix;
123 while(distMatrixTemp < distMatrixEnd)
124 if(isinf(*distMatrixTemp++))
125 *(distMatrixTemp-1) = infValue;
Astro 585 Lab 1 Ford.py (https://github.com/benelson/Astro585-1.git) Python · 248 lines
cprob.patch (https://github.com/ychaim/qml.git) Patch · 182 lines
56 +#ifndef NO_MTHERR
57 +extern double NAN; /* defined in const.c */
58 +#define mtherr(name, code) do { return NAN; } while (0)
59 #endif
103 return(NAN);
104 #else
105 -if( !isfinite(x) )
106 +if( x == INFINITY || x == -INFINITY )
107 return(x);
121 #ifdef INFINITIES
122 -if( !isfinite(x) )
123 +if( x == INFINITY || x == -INFINITY )
124 return(INFINITY);
Float.java (https://github.com/scalagwt/google-web-toolkit-svnmirror.git) Java · 255 lines
tgammaf.c (https://github.com/scottt/cygwin-vmci-sockets.git) C · 265 lines
grisu.jl (https://github.com/cloudchamber/julia.git) Lisp · 157 lines
25 global grisu, grisu_fix, grisu_sig
26 function grisu(x::Float64, mode::Integer, ndigits::Integer)
27 if !isfinite(x); error("non-finite value: $x"); end
28 if ndigits < 0; error("negative digits requested"); end
29 @grisu_ccall x mode ndigits
53 pt = _jl_point[1]
54 if mode == GRISU_PRECISION
55 while len > 1 && _jl_digits[len] == '0'
56 len -= 1
57 end
74 # => 0.00########
75 write(io, "0.")
76 while pt < 0
77 write(io, '0')
78 pt += 1
exp.jl (https://github.com/JuliaLang/julia.git) Julia · 236 lines
32 buf[pos + 2] = UInt8('N')
33 return pos + 3
34 elseif !isfinite(x)
35 buf[pos] = UInt8('I')
36 buf[pos + 1] = UInt8('n')
61 len = lengthforindex(idx)
62 i = len - 1
63 while i >= 0
64 j = p10bits - e2
65 #=@inbounds=# mula, mulb, mulc = POW10_SPLIT[POW10_OFFSET[idx + 1] + i + 1]
97 idx = div(-e2, 16)
98 i = MIN_BLOCK_2[idx + 1]
99 while i < 200
100 j = 120 + (-e2 - 16 * idx)
101 p = POW10_OFFSET_2[idx + 1] + i - MIN_BLOCK_2[idx + 1]
rational.jl (https://github.com/cyrilmhansen/julia.git) Lisp · 197 lines
fixed.jl (https://github.com/JuliaLang/julia.git) Julia · 182 lines
28 buf[pos + 2] = UInt8('N')
29 return pos + 3
30 elseif !isfinite(x)
31 buf[pos] = UInt8('I')
32 buf[pos + 1] = UInt8('n')
52 len = lengthforindex(idx)
53 i = len - 1
54 while i >= 0
55 j = p10bits - e2
56 #=@inbounds=# mula, mulb, mulc = POW10_SPLIT[POW10_OFFSET[idx + 1] + i + 1]
94 end
95 end
96 while i < blocks
97 j = 120 + (-e2 - 16 * idx)
98 p = POW10_OFFSET_2[idx + 1] + UInt32(i) - MIN_BLOCK_2[idx + 1]
shortest.jl (https://github.com/JuliaLang/julia.git) Julia · 494 lines
94 if a_allzero || b_allzero
95 # a) slow loop
96 while true
97 c_div10 = div(c, 10)
98 a_div10 = div(a, 10)
112 end
113 if a_allzero
114 while true
115 a_div10 = div(a, 10)
116 a_mod10 = (a % UInt32) - UInt32(10) * (a_div10 % UInt32)
147 e10 += 2
148 end
149 while true
150 c_div10 = div(c, 10)
151 a_div10 = div(a, 10)
grisu.jl (https://github.com/stevengj/julia.git) Julia · 165 lines
28 # wrapper for the core grisu function, primarily for debugging
29 function grisu(x::Float64, mode::Integer, ndigits::Integer)
30 if !isfinite(x); error("non-finite value: $x"); end
31 if ndigits < 0; error("negative digits requested"); end
32 @grisu_ccall x mode ndigits
60 pt = POINT[1]
61 if mode == PRECISION
62 while len > 1 && DIGITS[len] == '0'
63 len -= 1
64 end
80 # => 0.00########
81 write(io, "0.")
82 while pt < 0
83 write(io, '0')
84 pt += 1