DevToys-app / DevToys

A Swiss Army knife for developers.
https://devtoys.app/
MIT License
26.94k stars 1.45k forks source link

Number Base Converter accepts larger values than the maximum #497

Open roumcha opened 2 years ago

roumcha commented 2 years ago

Description

Some values larger than the maximum causes Number Base Converter to display a negative value in the decimal field instead of the warning "The current value cannot be converted …".

Steps To Reproduce

  1. Enter one of the following numbers to the hexadecimal, octal or binary field
  1. No warnings appears at the top and a negative number is displayed in the decimal field
  2. Entering a number larger than the above results in the correct warning

Expected behavior

Display the warning "The current value cannot be converted as it exceeds …" at the top.

DevToys Version

Version 1.0.6.0 | X64 | RELEASE | c032ebb | c032ebb; OS Version: 10.19044.1645

Relevant Assets/Logs

スクリーンショット 2022-04-21 000940
TimBlome commented 2 years ago

Not sure what the expected behaviour is, but this is occurring for every HEX number larger then '8000 0000 0000 0000'. It is just this 64 bit representation cast to a long signed integer i guess🤔 The shown binary value as int64 is indeed -1