#!/usr/bin/env perl use utf8; ############################################################################### # This program demonstrates floating point underflow. # # Copyright © 2020 Richard Lesh. All rights reserved. ############################################################################### use strict; use warnings; MAIN: { binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); binmode(STDIN, ":utf8"); my $small_float = 1e-308; print "Small float: ", $small_float, "\n"; $small_float /= 1e12; print "Smaller float: ", $small_float, "\n"; $small_float /= 1e12; print "Smallest float: ", $small_float, "\n"; }