Skip to content

Floating-Point Number based on 10 for Redis.

License

Notifications You must be signed in to change notification settings

alxgh/redis-decimal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Docker Cloud Build Status GitHub

RedisDecimal: Floating-Point Number based on 10 for Redis

Quick Start Guide

1. Building and Loading

To build RedisDecimal, ensure you have cmake and make, and afterwards run the following command.

cmake .
make

If the build is successful, you'll have a shared library called libdecimal.so in the lib directory.

To load the library, pass its path to the --loadmodule directive when starting redis-server:

$ redis-server --loadmodule ./lib/libdecimal.so

2. Use RedisDecimal with redis-cli

# redis-cli
127.0.0.1:6379>

And run the following command:

127.0.0.1:6379> DECIMAL KEY ADD 10
"30.000000"
127.0.0.1:6379> DECIMAL KEY SUB 10 
"-10.000000"
127.0.0.1:6379> DECIMAL KEY MUL 10
"200.000000"
127.0.0.1:6379> DECIMAL KEY DIV 10
"0.500000"

Extensions

Test for RedisDecimal

To build RedisDecimal, and run the unit testing.

cmake .
make
./.tests/tests

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%