Changeset 17861


Ignore:
Timestamp:
03/09/21 07:59:31 (18 months ago)
Author:
gkronber
Message:

#3112: fixed overflow because of integer cast in ChartUtil

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ChartUtil.cs

    r17180 r17861  
    8888    private static double RoundDown(this double value, int decimalRank) {
    8989      if (decimalRank > 0) {
    90         var floor = (int)Math.Floor(value);
    91         var pow = (int)Math.Pow(10, decimalRank);
     90        var floor = Math.Floor(value);
     91        var pow = Math.Pow(10, decimalRank);
    9292        var mod = Mod(floor, pow);
    9393        return floor - mod;
     
    9898    private static double RoundUp(this double value, int decimalRank) {
    9999      if (decimalRank > 0) {
    100         var ceil = (int)Math.Ceiling(value);
    101         var pow = (int)Math.Pow(10, decimalRank);
     100        var ceil = Math.Ceiling(value);
     101        var pow = Math.Pow(10, decimalRank);
    102102        var mod = Mod(ceil, pow);
    103103        return ceil - mod + pow;
Note: See TracChangeset for help on using the changeset viewer.