iBusiness
Macro ABS: 42 Pisci...
 
Share:
Notifications
Clear all

Macro ABS: 42 Piscine, Day08 - ex03, ft_abs.h  

  RSS

Isaac More
(@isaacmore)
Member Admin
Joined: 1 year ago
Posts: 189
19/06/2020 10:46 am  

Create a macro ABS which replaces its argument by its absolute value. 

Prototyped as:

# define FT_ABS_H

Suggested Solution to help guide you

/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_abs.h                                           :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: rariosa- <rariosa-@student.42.fr>          +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2017/08/17 15:04:47 by rariosa-          #+#    #+#             */
/*   Updated: 2017/08/17 15:19:59 by rariosa-         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#ifndef FT_ABS_H

# define FT_ABS_H
# define ABS(x) ((x) < 0 ? -x : x)

#endif

Quote
Share:

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. OK Read More