OLD | NEW |
1 /* | 1 /* |
2 ********************************************************************** | 2 ********************************************************************** |
3 * Copyright (C) 1997-2014, International Business Machines | 3 * Copyright (C) 1997-2014, International Business Machines |
4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
5 ********************************************************************** | 5 ********************************************************************** |
6 * | 6 * |
7 * File DIGITLST.CPP | 7 * File DIGITLST.CPP |
8 * | 8 * |
9 * Modification History: | 9 * Modification History: |
10 * | 10 * |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 * Set an int64, via decnumber | 697 * Set an int64, via decnumber |
698 */ | 698 */ |
699 void | 699 void |
700 DigitList::set(int64_t source) | 700 DigitList::set(int64_t source) |
701 { | 701 { |
702 char str[MAX_DIGITS+2]; // Leave room for sign and trailing nul. | 702 char str[MAX_DIGITS+2]; // Leave room for sign and trailing nul. |
703 formatBase10(source, str); | 703 formatBase10(source, str); |
704 U_ASSERT(uprv_strlen(str) < sizeof(str)); | 704 U_ASSERT(uprv_strlen(str) < sizeof(str)); |
705 | 705 |
706 uprv_decNumberFromString(fDecNumber, str, &fContext); | 706 uprv_decNumberFromString(fDecNumber, str, &fContext); |
707 internalSetDouble(source); | 707 internalSetDouble(static_cast<double>(source)); |
708 } | 708 } |
709 | 709 |
710 /** | 710 /** |
711 * Set an int64, with no decnumber | 711 * Set an int64, with no decnumber |
712 */ | 712 */ |
713 void | 713 void |
714 DigitList::setInteger(int64_t source) | 714 DigitList::setInteger(int64_t source) |
715 { | 715 { |
716 fDecNumber=NULL; | 716 fDecNumber=NULL; |
717 internalSetInt64(source); | 717 internalSetInt64(source); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 UBool | 939 UBool |
940 DigitList::isZero() const | 940 DigitList::isZero() const |
941 { | 941 { |
942 return decNumberIsZero(fDecNumber); | 942 return decNumberIsZero(fDecNumber); |
943 } | 943 } |
944 | 944 |
945 U_NAMESPACE_END | 945 U_NAMESPACE_END |
946 #endif // #if !UCONFIG_NO_FORMATTING | 946 #endif // #if !UCONFIG_NO_FORMATTING |
947 | 947 |
948 //eof | 948 //eof |
OLD | NEW |