------------------------------------------------------------------ */ decFloatCopySign -- copy a decFloat with the sign of another */ / result gets the result of copying dfl with the sign of dfr */ dfl is the first decFloat (lhs) */ dfr is the second decFloat (rhs) */ returns result
| 1860 | /* This is a bitwise operation; no errors or exceptions are possible. */ |
| 1861 | /* ------------------------------------------------------------------ */ |
| 1862 | decFloat * decFloatCopySign(decFloat *result, |
| 1863 | const decFloat *dfl, const decFloat *dfr) { |
| 1864 | uByte sign=(uByte)(DFBYTE(dfr, 0)&0x80); // save sign bit |
| 1865 | if (dfl!=result) *result=*dfl; // copy needed |
| 1866 | DFBYTE(result, 0)&=~0x80; // clear sign .. |
| 1867 | DFBYTE(result, 0)=(uByte)(DFBYTE(result, 0)|sign); // .. and set saved |
| 1868 | return result; |
| 1869 | } // decFloatCopySign |
| 1870 | |
| 1871 | /* ------------------------------------------------------------------ */ |
| 1872 | /* decFloatDigits -- return the number of digits in a decFloat */ |
no outgoing calls
no test coverage detected