ex3

command
v0.0.0-...-17a1818 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2023 License: MIT Imports: 1 Imported by: 0

README

Exercise 3

Question

Write a program with three variables, one named b of type byte, one named smallI of type int32, and one named bigI of type uint64. Assign each variable the maximum legal value for its type, then add 1 to each variable. Print out their values.

Solution

The maximum values for each type is specified in the table in Chapter 2. If you are industrious, you can also find the constants declared in the standard library in the math package.

Adding 1 to each variable causes an overflow, not an error. You get the minimum value for each one.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL