Skip to content

natamun/42-cpp02

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42-cpp02

The third C++ module of the 42 curriculum, focused on operator overloading and fixed-point numbers.

This project implements a fixed-point number class using a bit-shift representation instead of native floats, along with the operator overloads (arithmetic, comparison, increment/decrement, stream insertion) required to make it behave like a built-in numeric type.

Usage

Each exercise (ex00 to ex02) contains its own Makefile. Compile and run individually:

cd ex00
make
./ex00

Exercises

  • ex00: Basic Fixed-point class with a fixed-point representation and getter/setter methods.
  • ex01: Conversion to/from int and float, plus a static point-generation function.
  • ex02: Full operator overloading (comparison, arithmetic, increment/decrement, min/max) for the Fixed-point class.

Code Structure

Each exercise is self-contained in its own directory with its own source files, header, and Makefile, following the standard 42 module layout.

About

A fixed-point number class in C++ with operator overloading.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors