Menu

#511 Conversion functions between numeric bases

v1.1.x
closed
None
v1.1.3
New Functionality
2021-03-22
2020-01-22
Erik Hänel
No

Implement conversion functions to convert numbers between multiple bases. Either via implicit conversion by entering prefixes like

b101001
0x23A4F
o215714

or by adding explicit conversion functions, which will enforce using strings

basetodec("0xFF", "hex") -> 255
dectobase(255, "hex") -> "0xFF"

Analysis:

Obviously, the used parser library does not support using prefixes on non-numeric expressions. Therefore it is needed that we implement the functionality as string functions using std::stringstream for example.

Implementation:

  • Implementation: The implementation was processed as proposed by the analysis.
  • Revision: [r806]
  • Implementation test: Values were converted from and to different numerical bases.

Documentation:

  • [x] ChangesLog updated
  • [x] Code changes commented
  • Documentation articles:
    • [x] corresponding documentation articles updated
    • [ ] new documentation articles created
    • [ ] not needed
  • Language files:
    • [x] corresponding language files updated
    • [ ] not needed

Tests:

Added to the SW tests. Tests run without any deviation.

Related

Commit: [r806]

Discussion

  • Erik Hänel

    Erik Hänel - 2020-11-15
    • status: open --> accepted
    • Version: Planned --> v1.1.3
     
  • Erik Hänel

    Erik Hänel - 2020-12-04
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -8,3 +8,25 @@
    
         basetodec("0xFF", "hex") -> 255
         dectobase(255, "hex") -> "0xFF"
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* [ ] ChangesLog updated
    +* [ ] Code changes commented
    +* **Documentation articles:**
    
    +    * [ ] corresponding documentation articles updated
    +    * [ ] new documentation articles created
    +    * [ ] not needed
    +* **Language files:**
    +    * [ ] corresponding language files updated
    +    * [ ] not needed
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2020-12-04
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -10,7 +10,7 @@
         dectobase(255, "hex") -> "0xFF"
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +Obviously, the used parser library does not support using prefixes on non-numeric expressions. Therefore it is needed that we implement the functionality as string functions using `std::stringstream` for example.
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2020-12-05
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -13,19 +13,19 @@
     Obviously, the used parser library does not support using prefixes on non-numeric expressions. Therefore it is needed that we implement the functionality as string functions using `std::stringstream` for example.
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation: The implementation was processed as proposed by the analysis.
    +* Revision: [r806]
    +* Implementation test: Values were converted from and to different numerical bases.
    
     ###Documentation:
    -* [ ] ChangesLog updated
    -* [ ] Code changes commented
    +* [x] ChangesLog updated
    +* [x] Code changes commented
    
     * **Documentation articles:**
    -    * [ ] corresponding documentation articles updated
    +    * [x] corresponding documentation articles updated
         * [ ] new documentation articles created
         * [ ] not needed
     * **Language files:**
    -    * [ ] corresponding language files updated
    +    * [x] corresponding language files updated
         * [ ] not needed
    
     ###Tests:
    
    • status: implementing --> testing
     

    Related

    Commit: [r806]

  • Erik Hänel

    Erik Hänel - 2021-03-22
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -29,4 +29,4 @@
    
         * [ ] not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +Added to the SW tests. Tests run without any deviation.
    
    • status: testing --> closed
     

Anonymous
Anonymous

Add attachments
Cancel