---
title: "64/96/128-Bit Unsigned Integer Math"
description: "[SPIN2](https://obex.parallax.com/code-language/spin2/) ## Introduction The Propeller 2 can use these libraries to handle 64/96/128-Bit Unsigned Integer Math! For the latest version of the full library, visit our OBEX link in [resources](#resources)! ## Methods These methods are included in 64, 96 and…"
url: "https://obex.parallax.com/docs/chips-tips/propeller-2/64-96-128-bit-unsigned-integer-math/"
updated: "2025-03-17"
category: Propeller 2
---

# 64/96/128-Bit Unsigned Integer Math

[SPIN2](https://obex.parallax.com/code-language/spin2/)

## Introduction

The Propeller 2 can use these libraries to handle 64/96/128-Bit Unsigned Integer Math!

For the latest version of the full library, visit our OBEX link in [resources](#resources)!

## Methods

These methods are included in 64, 96 and 128 bit versions! To download the methods, visit our OBEX link in [resources](#resources)!

| Method name | Description |
| --- | --- |
| **FloatingNEGQ()** | **negate** |
| **ADDQ()** | **add** |
| **SUBQ()** | **subtract** |
| **CMPQ()** | **compare** |
| **MAGQ()** | **magnitude** |
| **SHLQ()** | **shift left** |
| **SHRQ()** | **shift right** |
| **MULQ()** | **multiply** |
| **DIVQ()** | **divide** |
| **LOGQ()** | **log2** |
| **EXPQ()** | **exp2** |
| **LongLSB()** | **extract long via LSB** |
| **LongMSB()** | **extract long via MSB** |
| **LongSHL()** | **left-shift long to make 64/96/128-bit value-point conversion methods** |

## Code Snippets

These two snippets demonstrate the add methods for 64-bit and 128-bit

```txt
PUB addq(int64 a, int64 b) : int64 r
'' 64-bit add
		org
		mov	r+0,a+0
		mov	r+1,a+1
		add	r+0,b+0	wc
		addx	r+1,b+1
		end
```

```txt
PUB addq(int128 a, int128 b) : int128 r
'' 128-bit add
		org
		mov	r+0,a+0
		mov	r+1,a+1
		mov	r+2,a+2
		mov	r+3,a+3
		add	r+0,b+0	wc
		addx	r+1,b+1	wc
		addx	r+2,b+2	wc
		addx	r+3,b+3
		end
```

---

## Resources

[Parallax Propeller 2 - Spin2 Language Documentation](https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/preview)

> [64/96/128-Bit Unsigned Integer Math](https://obex.parallax.com/obex/64-96-128-bit-integer-math/)

[“64/96/128-Bit Unsigned Integer Math” — Propeller OBEX](https://obex.parallax.com/obex/64-96-128-bit-integer-math/embed/#?secret=Lv7jVgTIsb#?secret=a67mduJWEA)

---
