ObjFW  Diff

Differences From Artifact [fb94e23de6]:

To Artifact [b4de2a5a33]:


1
2

3
4
5
6
7
8
9
1

2
3
4
5
6
7
8
9

-
+







/*
 * Copyright (c) 2008 - 2009
 * Copyright (c) 2008 - 2010
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
52
37
38
39
40
41
42
43

44

45
46
47
48
49
50
51







-
+
-







	OF_NUMBER_PTRDIFF,
	OF_NUMBER_INTPTR,
	OF_NUMBER_FLOAT,
	OF_NUMBER_DOUBLE,
};

/**
 * The OFNumber class provides a way to store a number in an object and to
 * \brief provides a way to store a number in an object and to manipulate it.
 * manipulate it.
 */
@interface OFNumber: OFObject
{
	union {
		char	       char_;
		short	       short_;
		int	       int_;
534
535
536
537
538
539
540
541
542
543

544
545
546
547
548
549
550

551
552
553
554
555
556
557

558
559
560
561
562
563
564

565
566
567
568
569

570
571
572
573
574

575
576
577
533
534
535
536
537
538
539


540
541
542
543
544
545


546
547
548
549
550
551


552
553
554
555
556
557


558
559
560
561
562
563

564
565
566
567
568

569
570
571
572







-
-

+




-
-

+




-
-

+




-
-

+




-
+




-
+




/**
 * \return The OFNumber as a double
 */
- (double)asDouble;

/**
 * Adds the specified OFNumber to the OFNumber.
 *
 * \param num The OFNumber to add
 * \return The OFNumber added with the specified OFNumber
 */
- add: (OFNumber*)num;

/**
 * Subtracts the specified OFNumber from the OFNumber.
 *
 * \param num The OFNumber to substract
 * \return The OFNumber subtracted by the specified OFNumber
 */
- subtract: (OFNumber*)num;

/**
 * Multiplies the OFNumber with the specified OFNumber.
 *
 * \param num The OFNumber to multiply with
 * \return The OFNumber multiplied with the specified OFNumber
 */
- multiplyWith: (OFNumber*)num;

/**
 * Divides the OFNumber by the specified OFNumber.
 *
 * \param num The OFNumber to divide by
 * \return The OFNumber devided by the specified OFNumber
 */
- divideBy: (OFNumber*)num;

/**
 * Increases the OFNumber by 1.
 * \return The OFNumber increased by one.
 */
- increase;

/**
 * Decreases the OFNumber by 1.
 * \return The OFNumber decreased by one.
 */
- decrease;
@end