install approved copyright notice
[unix-history] / usr / src / lib / libc / vax / gen / modf.s
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
.asciz "@(#)modf.s 5.4 (Berkeley) %G%"
#endif /* LIBC_SCCS and not lint */
/*
* double modf (value, iptr)
* double value, *iptr;
*
* Modf returns the fractional part of "value",
* and stores the integer part indirectly through "iptr".
*/
#include "DEFS.h"
ENTRY(modf, 0)
emodd 4(ap),$0,$0f1.0,r2,r0
jvs 1f # integer overflow
cvtld r2,*12(ap)
ret
1:
subd3 r0,4(ap),*12(ap)
ret