Skip to content

Instantly share code, notes, and snippets.

@saursin
saursin / bashrc
Created January 14, 2024 06:36
Simple bashrc for dev containers
################################################################################
# A Simple Bashrc for dev containers
clr_blk="\[\033[01;30m\]" # Black
clr_red="\[\033[01;31m\]" # Red
clr_grn="\[\033[01;32m\]" # Green
clr_ylw="\[\033[01;33m\]" # Yellow
clr_blu="\[\033[01;34m\]" # Blue
clr_mgn="\[\033[01;35m\]" # Purple
clr_cyn="\[\033[01;36m\]" # Cyan
@saursin
saursin / ieee754.m
Created June 27, 2021 18:59
Converts a single/double precision floating point number to its bitvector representation.
function [binVec, sign, exponent, mantessa] = ieee754(num,fmt)
% Converts a single/double precision floating point number to its
% bitvector representation.
% Usage :
% [binVec, sign , exponent, mantessa] = ieee754(X, fmt)
%
% X : single/double precision floating point number.
% fmt : target format, can be 'single' or 'double'.
%
% binVec : 32/64 bit binary vector.