Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CI1164 - Utils
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armando Luiz Nicolini Delgado
CI1164 - Utils
Commits
ca72d61e
Commit
ca72d61e
authored
1 year ago
by
Armando Luiz Nicolini Delgado
Browse files
Options
Downloads
Patches
Plain Diff
/* Alteração na definição de macro 'isPot2' */
parent
b726a6c9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/utils.h
+6
-5
6 additions, 5 deletions
utils/utils.h
with
6 additions
and
5 deletions
utils/utils.h
+
6
−
5
View file @
ca72d61e
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#include
<time.h>
#include
<time.h>
#include
<sys/time.h>
#include
<sys/time.h>
// Valor absoluto de um número. Alternativa ao uso da função 'fabs()'
// Valor absoluto de um número
real
. Alternativa ao uso da função 'fabs()'
#define ABS(num) ((num) < 0.0 ? -(num) : (num))
#define ABS(num) ((num) < 0.0 ? -(num) : (num))
// real_t: tipo usado para representar valores em ponto flutuante
// real_t: tipo usado para representar valores em ponto flutuante
...
@@ -23,11 +23,12 @@ typedef double rtime_t;
...
@@ -23,11 +23,12 @@ typedef double rtime_t;
#define ALIGN_16 __attribute__((aligned(16)))
#define ALIGN_16 __attribute__((aligned(16)))
#define ALIGN_8 __attribute__((aligned(8)))
#define ALIGN_8 __attribute__((aligned(8)))
// Número máximo de dígitos em um número
// Número máximo de dígitos em um número
inteiro
#define numDigits(n) 6 // ( (int) log10(
n) +
1 )
#define numDigits(n) 6 // (
n ?
(int) log10(
ABS(n)) + 1 :
1 )
// Macro para verificar de valor 'n' é potência de 2 ou não
// Macro para verificar de valor 'n' é potência de 2 ou não.
#define isPot2(n) (n && !(n & (n - 1)))
// 'n' DEVE ser positivo e não-nulo
#define isPot2(n) (!(n & (n - 1))) // #define isPot2(n) (n && !(n & (n - 1)))
// Funções
// Funções
rtime_t
timestamp
(
void
);
rtime_t
timestamp
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment