Skip to content

Commit

Permalink
Adding comment
Browse files Browse the repository at this point in the history
  • Loading branch information
whaeck committed Apr 9, 2024
1 parent 0c3d612 commit 540e045
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/tools/disco/Integer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class Integer : public BaseFixedWidthField< Width > {
template< typename Representation, typename Iterator >
static void write( const Representation& value, Iterator& iter ) {

// std::abs does not exist for all integer types (e.g. unsigned)
const Representation absValue = value < 0 ? -value : value;
const auto required = minimumRequiredWidth( absValue )
+ ( value < 0 ? 1 : 0 );
Expand Down

0 comments on commit 540e045

Please sign in to comment.