• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

超漢字上で、mrubyを使ってhello worldを表示させる。


Commit MetaInfo

Revisionc1ae16729a3b4733f0435041ed498852a2ffa1fc (tree)
Time2014-07-22 01:46:13
Authorornse01 <ornse01@user...>
Commiterornse01

Log Message

fix isinf() and isnan()

Change Summary

Incremental Difference

--- a/src/posix.c
+++ b/src/posix.c
@@ -6,7 +6,7 @@
66
77 double __nan()
88 {
9- static char nan_byte[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f};
9+ static char nan_byte[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff};
1010 return *(double*)nan_byte;
1111 }
1212
@@ -19,7 +19,8 @@ int isnan(double x)
1919 int isinf(double x)
2020 {
2121 double inf = INFINITY;
22- return memcmp(&x, &inf, sizeof(double)) == 0;
22+ double ninf = -inf;
23+ return (memcmp(&x, &inf, sizeof(double)) == 0) || (memcmp(&x, &ninf, sizeof(double)) == 0);
2324 }
2425
2526 int isfinite(double x)