HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to HaskellVariables (let)Data TypesOperatorsStringsListsConditions (if / then / else)Iteration (map / sum)Functions
REFERENCE
📖 Overview
🖥️ Output
📦 Value & Type
🔢 Numbers & Math
Math operatorssqrt / abs / ^
✍️ String
📚 List
🔀 Condition
🧩 Function
Haskell›REFERENCE›Numbers & Math›Math operators

Math operators

Four basic operations, integer division, and remainder.

Syntax

+  -  *  div  mod  /

Description

Integer division is with div, and remainder with mod. / is only used with floating-point (Double) numbers (7.0/2.0).

Example

Loading editor…

Expected output

10
3
1
3.5

When to use?

Calculations, even/odd check (mod x 2 or even).

Common mistakes

  • ⚠️ Do not use / with Int; perform integer operations with div/mod.

Related commands

sqrt / abs / ^
sqrt / abs / ^ →
HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code