This language bar is your friend. Select your favorite languages!

Idiom #192 Declare a real variable with at least 20 digits

Declare a real variable a with at least 20 digits; if the type does not exist, issue an error at compile time.

decimal a = 1234567890.12345678901m;
  integer, parameter :: qp = selected_real_kind(20)
  real(kind=qp) :: a
use bignum;
my $a = 12345678901234567890.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
require 'bigdecimal'
a = BigDecimal('1234567890.12345678901')
require 'bigdecimal'
a = BigDecimal('1234567890.12345678901')

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

tkoenig