Changes between Version 6 and Version 7 of CodingGuidelines


Ignore:
Timestamp:
Mar 29, 2012, 10:21:37 AM (13 years ago)
Author:
FrederikHeber
Comment:

added style on specific initial values

Legend:

Unmodified
Added
Removed
Modified
  • CodingGuidelines

    v6 v7  
    9999 return(foo);
    100100}}}
     101
     102=== Specific (initial) values of variables === #code-good-bad-limits
     103
     104In general __all__ variables __always__ have to be initialized (we don't care about the extra tic, even if operating system guarantees zero as default memory value).
     105
     106If they have to be set to some very small or very big value, use std::numeric_limits
     107{{{
     108  double smalldouble = std::numeric_limits<double>::min();
     109  double largedouble = std::numeric_limits<double>::max();
     110}}}
     111Also remember that there are also ::infinity() and alikes to set an illegal value which can be checked.